export default [
{
    path: "/home",
    component: () => import("@/pages/Home/Home.vue"),
    meta: {
        show: true
    }
},
{
    path: "/center",
    component: () => import("@/pages/Center"),
    children:[
        {
            path:"myorder",
            name:"MyOrder",
            component:() => import("@/pages/Center/myOrder")
        },
        {
            path:"grouporder",
            name:"GroupOrder",
            component:() => import("@/pages/Center/groupOrder"),
        },
        {
            path:"/center",
            redirect:"/center/myorder"
        }
    ],
    meta: {
        show: true
    }
},
{
    path: "/paysucess",
    component: () => import("@/pages/PaySuccess"),
    beforeEnter: (to, from, next) => {
      if(from.path == '/pay') {
        next()
      }  else {
        next(false)
      }
    },
    meta: {
        show: true
    }
},
{
    path: "/pay",
    component: () => import("@/pages/Pay"),
    beforeEnter: (to, from, next) => {
      if(from.path == '/trade') {
        next()
      } else {
        next(false)
      }
    },
    meta: {
        show: true
    }
},
{
    path:"/shopcart",
    name:"ShopCart",
    component:() => import("@/pages/ShopCart"),
    meta: {
        show: true
    }
},
{
    path:"/trade",
    name:"Trade",
    component:() => import("@/pages/Trade"),
    beforeEnter: (to, from, next) => {
        if(from.path == '/shopcart') {
            next()
        } else {
            next(false)
        }
    },
    meta: {
        show: true
    }
},
{
    path:"/addcartsucess",
    name:"AddCartSucess",
    component: () => import("@/pages/AddCartSuccess"),
    meta: {
        show:true
    }
},
{
    name: "search",
    path: "/search/:keyword",
    component: () => import("@/pages/Search"),
    meta: {
        show: true
    }
},
{
    path: "/login",
    component: () => import("@/pages/Login"),
    meta: {
        show: false
    }
},
{
    path: "/register",
    component: () => import("@/pages/Register"),
    meta: {
        show: false
    }
},
{
    path: "/detail/:skuid",
    component: () => import("@/pages/Detail"),
    meta: {
        show: false
    }
},
// 重定向:使访问8080时直接跳转到home首页
{
    path: "*",
    redirect: "/home"
}

]